package cairngorm.command
{
	import cairngorm.business.UserDelegate;
	import cairngorm.event.UserLoginEvent;
	import cairngorm.vo.UserVo;
	
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	
	import mx.rpc.IResponder;

	public class UserLoginCommand implements ICommand, IResponder{
		public function UserLoginCommand(){
	
		}
		
		public function execute(event:CairngormEvent):void{
			trace('step3: loginCommand execute and send to userDelegate');
			var user:UserVo = (event as UserLoginEvent).userVo;
			var userDelegate:UserDelegate = new UserDelegate(this);
			userDelegate.login(user);
		}
		
		public function fault(info:Object):void{
			
		}
		
		public function result(data:Object):void
		{
			var user:UserVo = data as UserVo;
			trace('step6: userLoginCommand receive result from userDelegate');
			
		}
		
	}
}